<?php


namespace App\Web\Controller;

use App\Web\Facades\UserAuth;
use App\Web\Model\InterviewDetail as InterviewDetailModel;
use EchoPHP\Http\Request;

class InterviewDetail extends Controller {
    /***
     * 查询面试通知详情
     */
    public function sel(Request $request){
        $oprId = $this->getLoginId();
        $pageNum = $request->getParam('pagenum/d', 1);
        $pageLimit = $request->getParam('pagelimit/d', 10);
        $search = [
            'batchcode' => $request->getParam('batchcode'),
        ];
        $interviewdetailModel = new InterviewDetailModel();
        list($pageNum, $rowFrom, $rowTo) = $interviewdetailModel->paginationParameters($pageNum, $pageLimit);
        $count = $interviewdetailModel->getCount($oprId, $search);
        if (0 == $count) {
            return $this->json(['status' => true, 'message' => '获取成功', 'totalcount' => 0, 'interviewdetaillist' => []]);
        }
        $interviewdetaillist = $interviewdetailModel->selDetail($oprId, $search, '', $rowFrom, $rowTo);
        return $this->json(['status' => true, 'message' => '获取成功', 'totalcount' => $count, 'info' => $interviewdetaillist]);
    }
}